package com.mtaite.study.mybatis.init;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;

import java.util.Arrays;

@Component
public class ConstructorBeanInit {

    private final Environment environment;
 
    @Autowired
    public ConstructorBeanInit(Environment environment) {
        //environment实例已初始化
        this.environment = environment;
        System.out.println("执行初始化-->ConstructorBeanInit"+Arrays.asList(environment.getDefaultProfiles()));
    }
}
